import 'package:flutter/material.dart';
class SearchBar extends StatefulWidget {
  @override
  _SearchBarState createState() => _SearchBarState();
}

class _SearchBarState extends State<SearchBar> {
  @override
  Widget build(BuildContext context) {
    void gotoSearchPage(){
      Navigator.pushNamed(context, '/search');
    }
    return Row(
      children: <Widget> [
        Expanded(child: Padding(
          padding: const EdgeInsets.all(16.0),
          child: TextField(
            decoration: InputDecoration(icon: Icon(Icons.search)),
            onTap: gotoSearchPage,
            readOnly: true,
          ),
        ))
      ],
    );
  }
}
